package charles.testproject.finalvariables;
/**
 * final field must be assigned when it being declared
 * or be assigned in the construct method
 * plus ,because the construct method will just be call
 * only one of them ,so writing the codes about assigned
 * the final field twice in two different construct method
 * will be ok. 
 * 
 * @author charles 2009-8-9
 *
 */
public class FinalvariablesGotValues {
	final int i;
	
	public FinalvariablesGotValues(){
		this.i = 1;
		System.out.println("final field i = " + i);
	}
	
	public FinalvariablesGotValues(int i) {
		this.i = i;
		System.out.println("final field i = " + i);
	}
	
	public static void main(String[] args) {
		FinalvariablesGotValues f = new FinalvariablesGotValues(5);
	}
	
	private void setInt(int i){
		//final field can not be assigned out of construct method
		//this.i = i;
	}
}
